added support for repeat to fit