use getWidth instead of width