adding js functionality