Fixed compatibilty for old PHP versions