updated script to get rid of php reference