Replaced deprecated function key_exists

Replaced deprecated function key_exists with array_key_exists