Create function if it is not defined