Bugfix: Sandbox sometimes couldn't finish the scheduled task due to a coding error + Support new events API