fixed the bug on remove_if