moved event listener so it wont fail