added else to ternary