bug fix for segment nucleus function