setting up the theads in the main activity