bug fixing for overlapping times