fixed wrong type from switch case