Added better error handling to scp