change parsing of handleMessageSentByJavaScript method