fixed if else condition