more input validation and mask exception