Added condition to the save data to BT function