fix #10 and fixes #11