check policy document valid or not when create/update a policy