checking js function