loading state and onresize