should fix #3 and fix #2 and possibly #1