fix assignment in conditional check