fixed classes inheritance bug