added new metod with wrtite to file