fix bug (closes #16)