Added Thread sleeping