clean up js function call