edit sendmessage to use constants properly