Removed the last fix, but trying similar idea with php cookbook.