Bug in accessing width and height