added input validations