Fixing wrong order in inheritence