Corrected typo in the error message
Added check for duplicate time stamp