fixed PHP5.3 incompatabilites