moved the error functions to the functions module