probably fix for #77 and #110

needs check