always close sth and db, even if no row was returned