Added javascript function