Fix bug with condition