json loading good but function