fixed bug w/ conditional assignment