Creating functions to display errors and warnings