Change indexOf to manual toggle

Add reset of toggle