added messages validation
added origin validation