Add version spec.Better error handling.Little code refactoring