input: Write a function to modify the provided Python code to handle errors when reading data from a JSON file. The function should return a message if the file does not exist and another message if 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('exists.json')!=None
  assert read_data_from_json('not_exists.json')==None
  assert read_data_from_json('invalid_format.json')==None
output: def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          return "The file specified does not exist."
      except json.decoder.JSONDecodeError:
          return "The file specified is not in a valid JSON format."