fixed a bug in cyclicworkflow

fixed a bug in cyclicworkflow, but there is som refactoring that needs to be done. details for the refactor found in https://www.pivotaltracker.com/story/show/70729950