Added some code to popup and overlay view