improve #56 (more to do)

fix small bug related to #58
fix #56