Update the 'used' flag correctly