hasKey bug fixed