fix platform event handling