implement @moly fix for inefficient quad tree