Fix for legacy php versions