added object validation (with JSON.stringify)