Fix bug of accessing global event object