added thread and some interface to module