fix bug in inheritance