modify function for bluetooth