fix bug for window minimize