added exit on error setting on script