prevent the window size to reach 0