Revised error checking statement