redone eventlistener to fix swallow bug.