fixes #30 - might not be the best way?