fix bad implementation