switch between public and private