couple of things to add multithreading safety