fixing some json loading bugs