Alternative for code
Else if was breaking the code