new version compatible with php54