Fix stop logic