Fixed error in getting registry value