better handling error; minor fix;
always use bash because there may be problems when using zsh;
adding job permissions;