fixed the on click function and repostioned the pop-up