Fix for error when deleting entries