reworked warning logic