Fixing php 5.2 bug