GotoIF Condition

Hello All,
I have a question related to GotoIf condition in asterisk.

Following Is the Dialplan that i m using

exten =>_XXXX.,n,GotoIf($[${ISNULL(${callerid})}=1]?yes:no)
exten =>_XXXX.,n(no),Noop(callerid not Set)
exten =>_XXXX.,n(yes),Set(callerid="1234")

What is happening here is when callerid is empty it goes in n(yes) label and if It is not empty then it executes both n(no) and n(yes). Because of which when the callerid is not empty it sets the callerid =1234 which shld be only set when callerid is empty.Please let me know how can i solve this issue.

Miss a priority between no and yes, or include an action that terminates the dialplan or transfers control to another part of it, between them.

Try this:

exten =>_XXXX.,n,GotoIf($[${ISNULL(${callerid})}=1]?yes:no)
exten =>_XXXX.,n(no),Noop(callerid not Set)
exten =>_XXXX.,n,GoTo(end)
exten =>_XXXX.,n(yes),Set(callerid="1234")
exten =>_XXXX.,n(end),Hangup()