replace isset with array_key_exists