fix a bug on line foot finding function