fix issues with wrong case statement