fixed if statement error that swallowed up the else part