fixes #223

i have deleted my old fork and created a clean one and reapplied my changes to address issue #223
please let me know if you are able to accept this PR