Defensive Programming solution added.