it is not good to have this check in the function that does the delete operation on data. let's think today how to do it in a better way.