Adding log and trying to get states to work.