fixed syntax errors in PHP <5.4