<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_policy(self,cspDefaultHeaders):
 		""" add items to existing csp policies """

		try:
			self.check_valid(cspDefaultHeaders)
			if self.inputs is not None:
				for p,l in self.inputs.items():
					cspDefaultHeaders[p] = cspDefaultHeaders[p]+ list(set(self.inputs[p]) - set(cspDefaultHeaders[p]))
				return cspDefaultHeaders
			else:
				return self.inputs
		except Exception, e:
			raise