Adding the conditional check