changed class.toString() to class.getName() to get the real class name
Thanks to Sebastian Bathke for the hint