added thread handling
todo read_limit