Extended crashing fix to the concise version.
Added looping functionality with a fallback javascript solution.