Fixed assigning undefined as the message