fix issue with back_uri when request.referer is nil