FIX: correct logic

correct logic for key comparison