updated to work without php module