added additional checking to ensure the correct JSON data types