define singleton and eliminate two warnings