added javascript callbacks