fixed bluetooth algorithm for receiving data