fix a bug if there was no listener