fix for #56, #113