added jsonfile & fixed some bugs