added method to generate message