Fix some background foreground lock unlock connction issues