fixed bug with warn method