using json to work proeprly