Minor modification on database connection