Fix factory bug that prevent from migrate db