improve bash script and error message from builder