fixed broken code in functions file