Update javascript for frontend