patched and fixed #23