small fix to error funcionality