some changes to solve #239