updated all code for php 5.3 compliance