Added a popup and bug fixes