Fixing logic thread error handling which ends up segmentatio fault

Change-Id: I9615f1d5bdde534464744537c79ac3d1497338dc
Signed-off-by: TanelDettenborn <tanel.dettenborn@gmail.com>