fix for NPE in event listener, but may be a larger issue