Changed resize method