fixed bug when params do not correspond to the expected class