Bugfix on policy writting