edited session in functions