Move the guard before the use of metaclass.