added pop up and bug fixes