Fix for thread-safe php