Added connected thread to manage bluetooth connection