check base.length instead of just base