resolve php dereferencing error