Modified "add" method.

To properly handle cases of null or empty String argument.