Issue with Hanging Thread