adding more event listeners, and console logs to better understand what's happening