crash fix when deleting row