added check for ruclassornil if the passed val is a class