Added workaround out of bound after repeat