messages not printing to terminal correctly