database settings bug fix
messages - little refactor