resolve button problem when resizing the window