fix bug with php warnings