migration to php 5.5, adding new functions, fix bugs