added validation for start and end dates