error check for vector