updates for safephp mode