added nonnull safety to listener