print error first