using booleans to avoid send commands over and over