creating and running a daemon thread