fixes bug that quit the program if the opening character of an input was 'q'