fix bug: array must be passed to array_key_exists()