fix inheritance bug