fix based on php 5.3