Add validations and fixed codes for PR