fix file comparison function