moved null check from handler invocation into event dispatching