partial fix #21. revisit later if need be