Fixed error in composing functions