Added logic to Run Thread