Changed isRegistered check to class_exists