added functionality for infinite story loops