fixes #50 with resize bug.