fix a bug check vector.empty()

check vector.empty()