PRD-3965 Adding validation and exception handling