Fixed getPolicy() method to make it thread-safe.