displaying errors dynamically