add error handling for bash using set