registry cancel button fixed, improved error-checking and handling