fixed a bug in inside

added multithreading feature