Bugfix for parallelisation