fixed a if branch