added classes for all docs, added db check