improved category delete process and modified ratchet.js to fix querSelector bug