fixed substring hack