changed maximize method