only execute callback when callback exists

because document said: Note that in either form the callback is optional

callback in  send_command function may be undefined. 

so only execute callback when callback exists