incorporate fix by Marek