Fixing duplicate message issue