add functional js