error handling and fixing dependencies for gem