Added function to display error messages in terminal window