fix for #237, thanks to @davideschiera for the fix