changed deprecated getRequest to get('request_stack')->getCurrentRequest()