Adds colors to output messages
Changed order of error checking