find function for error warning