Fix exception on key existance check