fixed bug in result type switch block