Fix android multithreading problem