fix unix timestamp function