wrapped class declaration in 'if' statements to avoid double-loading class errors.