fist implementation for #251