fix false branch logic