Inheritance didn't work as expected