little fix on the if then else