non working example of a thread safe