add javascript logic