fix loading of functions directory