fixes #16 (but checks should be improved)