Fixed javascript error for video pause on close button click event