modified to print message