fix with checking key existing