Added correct key comparison