first stab at fixing #5