fixed function calls and test