save pattern and redirect