added timestamps, fixed a crashing condition