fix a bug on createClass method