Fixed exception handling of listener