update the drawbox function.