fixed the bug for maximize (typooo)