fixed bug in orientation