Made code check permissions and ownership AFTER any updates have been performed