bug fix and test for time boundary