fixed the adding of the functions not working