Fix function definition not found error thrown sometimes