Added IsError Function and tests