moved getting current timestamp till after we grab the lock