applied patch from Matthias Clasen <maclas@gmx.de> to check for