Changed function to create timestamp