Fixed additional potential crash when $request is not defined