changed some class names, added db check function