fixed a bug in inside

Added multithreading