fixed bug with non-square sizes