add if statement to validate the condition