Added unit test and fixed bug for UserMigrated message