remove unuseful
modify for thread safe
change sql library