fixed some code system issues