small update to avoid null references