this needs to happen in the "else if" and not in the inner if