Fix the nil? issue due to the rubocop upgrade