moved printing of bell char to exit code handling function