MAJOR BUG fixed

Frequent segmentation fault solved.