exit with error in case of error