Added warning logic