added if/else statement to task update for validation