Added method to close window by pressing 'q'