using key_exists() instead of isset() for checking if an array key is defined and exists.