logic for current stage route