duplicated function made to global