fixed a bug in php 5.5+