set error flag to bash