Added DOM event listener before adding the details