logic fix for the last fix