fixed issues with if else if