fixed minor bug with the error checking
/bin/bash: q: command not found