fix according to code review
add registry options