added validation function for timestamp