fixed inversion function call