fixed bug with unclosed db connection
added few log msgs