functions to help print out errors