fixed a bug in unit cell