added functionality to js