fix IllegalArgumentException noticed by @sgalles