even more logic fixes