fixes bug for old php versions