Updated with working database connection and reading