fixed resizing finally.
merged Achal and Andre