Small logic fix