Code's now working with symfony 2.4 version