improve error handling and readme.