add sha1, better error reporting