fix bug which takes out boxes sometimes