it fails here:

cube.position=vector(0,0,0);