Fixed a Logic error in last commit