fix free bug, slight mods to break logic