added js functionality