Finally fixed the function calls