Fixed deprecated warning for 'add' method.