create js function userActive