change a judge for Add function