Made few changes in delete/update to catch some errors