moved listener to inside div object