Fixing bug in php state