pattern transition function finished