Made SQL update on a thread to save bandwith