Invoke sendToTarget() for send message to Handler
Added comments and change some global variables to local variables.