regex fix + code change