fix compat issue with php 5.2