input: Write a function to modify the given Python code so that it includes error handling. The function should attempt to read data from a JSON file and handle cases where the file is not found or the file is not in a valid JSON format.
  
  def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
  
  assert read_data_from_json('path/to/nonexistent_file.json')==None
  assert read_data_from_json('path/to/invalid_json_file.json')==None
  assert read_data_from_json('path/to/valid_json_file.json')=={"key": "value"}
output: def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
          return None
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
          return None