Fix for #40 was a bit broken ups