Updates helper function for compatibility with php version 5.5.x