fixing problem in decorator when request is not defined