fix bugs in quad tree