add vector size check