fix on/off mode on resize