fix box drawing bugs