changed to JQuery and fixed the close button