fixed if else structure