fix odd behaviour

fix #11889

cc @DeepDiver1975 @PVince81 @LukasReschke