Fix app freeze (Agent)