amend some logic