Some fixes for chat logs

It should work **properly** now
Make the path to the db a global variable