Log state when executing scripts
Finnaly fix the twice online event bug