added messages handler