Dynamically updating state before sending changes to client

Signed-off-by: Thomas Pasch <thomas.pasch@gmx.de>