switched api's to be a little more safe and transparent + no more threading issues