Fixes an exception when handler is nil