add type for javascript calling