added resizing support