make it work on iOS. fixes #20