fixed bug with class inheritance