fixed undefined issue with message