fixed some php errors