bug fix and use unix timestamp