fix a bug in warnings