fixed resizing issues (w/ help from Gonzalo)