Done the if block in kgpkubs code

Hi arpit. I've added the if block in kgpkubs code.