modified SP for validation