fixing bug in orientation