Updated router with previous() method