Fix php runtime error