fix js function calls