Handle resizing and add scrolling