exit with non-zero on errors
fix bash syntax error