fixed a bug on getting the message names from an object