added a function so that you can click out of the popup box. not sure if i want that though