use isset() instead of array_key_exists()