fixed reverse if