added getNext method for retrieving next sequence value