fixed up some logic