edit some logic