fix bug for is_required