implementation of #108