backtracking on db gems