fixed a bunch of function calls