adding the name of function to error methods