Fixing output message issue