fix warning logic