Fix error with incorrect function calling