fix dict key check