reg key already exist bug fixed, logging improved