fixing test so that emit is outside of when identity message is received