add else to fix switch issue