added in null check to fix validation error