ah crap! just done to refactor but seg fault error