fixes function composition bug