finish preferences dialog