fix conditional assignment