Change the condition for the stop position