Yup, this is exactly what HMRC sought to clamp down on as it is seen as a means of avoiding tax and NI. So the rules were changed to make it tax evadance (illegal), not tax avoidance (legal). What you have been doing with your friend up to the end of the tax year had to be managed in a particular way with HMRC (by declaring that you were operating in a particular manner, so that tax and NI were deducted correctly).
What you are now intending to do to is more legit provided that you can demonstrate to HMRC that your limited company is providing a service and not that it is just you providing personal services through your limited company.