fixed freeze bug closes #21