add the external fun in constructor function