added some box logic