Function was defined twice, and wromg one was being picked by the admin