check that the function is loaded before calling it