Make registry resource work reliably