fixing event/resize bugs