replaced deprecated Curses.endwin with Curses.close_screen