fixed return value behaviour for warn on duplicate