implemented temporary javascript logic