fixes for php verions earlier than 5.5