function to delete duplicate lines