added clang error checking