fixed table inheritance code