added inherit js function