fixed #209 and also fixed #213