setting the box logic