Better and cleaner solution to fix #20 suggested by @ayosec