add animation into msg function