Update functions javascript