improve inherits so instanceof works