share bit switch, modified for empty model, avoided infinite loop and necessary changes