this function is not and not supposed to be called without window(), assert it, or declare param as const reference &, so it never called without window argument