testing logic fixes