revised for regcheck and ssh