Fix bug so resizing window looks better