fixed a bug with T used as TRUE in r