exit program after printing error message