put fundtion inside function