v1.0.2; fix incorrect detect of mainCtx