Added minimize when popstate