probably fixed #233
closes #247 and fixes a crash bug
closes #232