add error.c and define