Why do we need to check if `request` is defined?