Resize method modified