added $ sign to js function