reworked the error displaying process