added some js functionality