add defer to db.Close()