Fix a bug of loading the functions