Add sendevent call with multithreading