replaced misuse of empty with clear on vector