Added check for R