update invokePlay to handle loops