Window resize bug solved