fixing orientation problems