adding event listener to try to deal with async requests