fixed bug with loading from JSON