fixed WindowsError at registry access