fixing up stuff to work with the new php