adds a fix for #1 and a test