Fix: rule out useless database processing