fixed timestamp bug and segmentation fault