Fix for new version (and to be compatible with older PHP verions)