Changed backup and made finding line more robust