fix a bug with php < 5.4.6