fixes the crash in #7. Needs to see if that works now