fixed error with global php variables