function pointer to err hand