IdCounter refactoring
added checking max id in loading DB
implemented reset id counter