added error functions