backtrack with working flag