* Make client code more thread safe

Signed-off-by: jirihnidek <jiri.hnidek@tul.cz>