Added better edit checks