Changed order of delete to do remote first