fix for rotated and reversed frames