Fixed the Resize methodd to work better