applied patch from Andreas Persenius <ndap@swipnet.se> that updates the