updated to delete first