fix compatibility and performance for ctor