Added DB logging