Some of my comments here are the same as for received_handler, so I'm not going to repeat them :)