fixes #367, thanks @Camaran