fixed class allocation errors