some changes in validation and auto populate values code