After hours of debugging, I finally fixed the problem that killed the frontend sometimes after ending runs.