Implement popup input logic. Fix quit logic.