fixed background thread's issues