Change logic order