Fixed the else if ladder