fix php compatibility issue, callback issue