work but bug on resize