completion logic improved