fixed onMessage callback