fixing repeat mode