fix applicationStateFile and make chat app work (sort of)