worked on thread constructor