add unit testing and create a test to reproduce #103