Fixed looping timestamp bug

Fixed the bug in the code, and renamed the variable to utstamp.