fixed an issue where the Received event is fired twice because of newline characters