detect when document resizes, kinda fixes #9