made some minor changes to the handler again