fix cycling functionality