bug fix for custom implementation