fixed resource leak in buildTimeStamp