added javascript function