corrrected some db access, added the sysstats