add "else if" statement with variable validation