- some logic fixes