work on thread_free_space