added else for ternary