made sure script checks out master branch succesfully before cleaning up