fixed a bug with orientation