add handler for 'received' event
a little fixes