Wrapping with class check