fixed issues #30 & #31