checking message origin before doing anything else