Switched the handler to a direct function