fix bug with deprecated function in symfony 2.3