Added check of input rh/rj