add function work to js