Adding the handler to the constructor