updated for php 5.5