added more validations and formatting