fix code for php 5.3