Updated getMessage to be more generic