Fixed NPE when listener is not set