added NSIsError helper