Buttons on popup working properly