Refactor: added function for errordetail
Fixed bug with git checkout paths, added addtional variable at the start of the script to define the location of t