minor changes on error functions
minor changes on error functions