added windowresize functionality