change argument types. new WorkerMessage(, handleMessage:Function = null, handleClose:Function = null) in MainThread