hack added to compensate for inversed bed rotation