add checks for null rows and row keys