fixes runtime errors