fix nil condition