implemet a function of draw box