Fixes broken case statement

You cant call case foo.class you have to compare it in an if statement