Refactor: we should not refere to window directly
Fix bug generated when the change of value -> message