fix #348

@davivel feel free to change branch if needed