Add sleeping thread func