fixed bug in errors