fixing logic bug in base()