fix and add some php code