moved sending messages to writeMaster from time window to message listener