Added code to handler function.