took over changes by @acpi from http://forum.oxid-esales.com/showthread.php?t=16297&page=8#post119141