fixed the resizing error