fixed an sql bug concerning reuse boxes