fixed bug in displaying error