Logic fixed