added some error and env checking to swift backup