Then you are not calling size() on the object you think you are.