fixed document example and added test