#983 fix as recommended by @fjirari