Fix doc typo and add additional if condition

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>