patch to address index cast notice from php 5.4