Change if-else condition in Add function of Ex