Added register js functionality