before deleteing resources