fixed a outofboundsexception in project2