fix function which only available when php>=5.3