fixed sementation faults