A simple metllod for testing goodness of fit in tile presence of nuisance parameters