Finalized method to validate the environment variable and added validate register file