Adding correct redirect handling