Adding ability to set Loop mode