fixed and added test to docs