updated with php code