fix another delete_if method