Used Codrut's version to solve conflict