Only output warning message when necessary