bug 1010: changed if then else to ternery operator