added term unlock code when user ends his program.