dynamic change the position of the box