Add log inside factory