fixes #177 and fixes #178