fixed a bug where width and height were flipped